<?php

namespace app\yunda\validate;
use think\Validate;
class Member extends Validate
{
    //定义验证规则
    protected $rule = [
        'level|会员等级' => 'require',
        'name|会员等级名称' => 'require',
        'fee|会员费用' => 'require|gt:0|regex:^\d{1,9}.{0,1}\d{0,2}$',
        'yh_fee|享有优惠' => 'require|gt:0|regex:^\d{1,9}.{0,1}\d{0,2}$',
    ];

    //定义验证提示
    protected $message = [
        'fee.regex' =>'会员费必须是数字，最多保留两位小数',
        'yh_fee.regex' =>'享有优惠必须是数字，最多保留两位小数',
    ];
}
